getGreetingFromDate

Returns a greeting based on the time of day. It checks the hour of the day and returns a corresponding greeting: "Good Morning!", "Good Afternoon!", or "Good Evening!".

Return

A greeting string based on the time of day.

Parameters

date

The current date and time used to determine the greeting.